const { defineConfig } = require("@vue/cli-service");
const path = require("path");
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  chainWebpack: (config) => {
    config.plugin("html").tap((args) => {
      args[0].title = "体系能力需求仿真系统";
      return args;
    });
    config.module.rule("svg").exclude.add(path.resolve("src/icons")).end;
    // 新增icons规则，设置svg-sprite-loader
    config.module
      .rule("icons")
      .test(/\.svg$/)
      .include.add(path.resolve("src/icons"))
      .end()
      .use("svg-sprite-loader")
      .loader("svg-sprite-loader")
      .options({ symbolId: "icon-[name]" }) // 使用图标的名称
      .end();
  },
  devServer: {
    proxy: {
      "/": {
        target: "http://localhost:8081",
        ws: false,
        changeOrigin: true,
        secure: false,
      },
    },
  },
});
